package server.container;

import java.util.ArrayList;
import java.util.List;

public class Feuerwehr {

	private String name = "";

	private int id = -1;
	
	private String typ = "";

	private List<Schleife> schleifen = new ArrayList<>();

	private boolean isFms = false;

	private boolean isPocsag = false;

	private boolean is5Ton = false;

	public boolean containsSchleife(String schleife) {

		for (Schleife s : schleifen) {
			if (s.getSchleife().equals(schleife)) {
				return true;
			}
		}
		return false;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public List<Schleife> getSchleifen() {
		return schleifen;
	}

	public void addSchleife(Schleife schleife) {
		
		this.schleifen.add(schleife);
		if (schleife.getTyp().equals("fms")) {

			isFms = true;
		} else if (schleife.getTyp().equals("pocsag")) {
			
			isPocsag = true;
		} else if (schleife.getTyp().equals("5ton")) {

			is5Ton = true;
		}
	}

	public boolean isFmsFeuerwehr() {

		return isFms;
	}

	public boolean isPocsagFeuerwehr() {

		return isPocsag;
	}

	public boolean is5TonFeuerwehr() {

		return is5Ton;
	}

	public void setTyp(String typ) {
		this.typ = typ;
	}
	
	public String getTyp() {
		return typ;
	}
}
